<template>
  <div v-title :data-title="title">
    <el-container>
      <el-main class="me-articles">
        <my-article-scroll-page v-bind:article1="article"></my-article-scroll-page>
      </el-main>
    </el-container>
  </div>
</template>

<script>
  import MyArticleScrollPage from '@/views/common/MyArticleScrollPage'
  import {
    getMyArticle
  } from '@/api/article'

  export default {
    name: "BlogMyArticle",
    components: {
      MyArticleScrollPage
    },
    created() {
      this.getMyArticle()
    },
    data() {
      return {
        article: {},
        page: {
          pageNumber: 1,
          pageSize: 10,
        },
      }
    },
    computed: {
      title() {
        return '我的文章 - 时光序'
      },
    },
    methods: {
      getMyArticle() {
        let that = this
        getMyArticle(this.$store.state.token, this.page).then((data => {
          this.article = data.data
        })).catch(error => {
          that.$message({
            type: 'error',
            message: '我的文章加载失败!',
            showClose: true
          })
        })
      }
    }
  }
</script>

<style scoped>
  .el-container {
    width: 640px;
  }

  .el-main {
    padding: 0px;
    line-height: 16px;
  }
</style>
